import { requests } from '@/utils/requests'
import type { User } from '@/model/user'

export const apiDoLogin = (phone: string, password: string) =>
  requests.post<string>('/user/login-pwd', { phone, password })

export const apiGetInfo = () => requests.get<User>('/user/info')

export const apiIsLogined = () => requests.get<void>('/user/is-logined')

export const apiUserDelete = (uid: number) => requests.delete(`/user/delete/${uid}`)
